package com.mayfool.task.entity;

import jakarta.persistence.*;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.util.Date;

/**
 * @author zhou.xu 2024/8/27 19:19
 */
@Data
@Entity
@EntityListeners({AuditingEntityListener.class})
@Table(indexes = {
        @Index(name = "idx_location", columnList = "location", unique = true)
})
public class Project {

    @Id
    @GeneratedValue
    private Long id;

    /**
     * 项目名称
     */
    @Column(nullable = false)
    private String name;

    /**
     * 本地文件路径
     */
    @Column(nullable = false)
    private String location;

    /**
     * 创建时间
     */
    @CreatedDate
    private Date createTime;

    /**
     * 更新时间
     */
    @LastModifiedDate
    private Date updateTime;
}
